<?php include_once("header.html")?>
<script src="<?php echo $www_site_url?>/public/js/PCASClass.js"></script>
<div id="wrap">  <br />
<?php include_once("home_left.html")?>
    <div class="admincontent">

      <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <form action="/index.php" method="GET">
      <input type="hidden" name="action" value="home">
      <input type="hidden" name="view" value="allassignment">
          <td><div class="table2TitleBg">
            <div class="table2TitleBg2">
            <div style="float:right;margin:5px;">
            	<select name="brand_id">
					<option value="">--品牌--</option><!-- added by Wendy -->
					<?php foreach ($brands as $v){?>
					<option value="<?php echo $v['b_id'];?>" <?php if($v['b_id'] == $current_bid) echo "selected"; ?>><?php echo splitx($v['b_name']);?></option>
					<?php } ?>
				</select>
	            <select name="province"></select>
	            <select name="city"></select>
	            <select name="area"></select> 
	            <input type="submit" class="btn"  value="Search">
            </div>
				<div class="table2Title"><div class="table2TitleLeft"><span><?php echo lang('assignment_board')?></span></div></div>
            </div>
           
           </div></td>
        </tr>
        </form>
       

        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            
       		 <tr>
              <td class="table2LeftBorder"></td>
              <td>
				<?php if(isset($assignments['records']) && is_array($assignments['records'])){
							foreach ($assignments['records'] as $v){?>	
                    <div class="mission">
	                      <div class="logo">
	                        <p><a href="/index.php/home/assignment/a_id/<?php echo $v['a_id']?>"><img src="/public/upload/logo/<?php if(!empty($v['b_logo'])) echo $v['b_logo'] ;else echo $v['c_logo']?>" width="68" height="68" border="0" /></a></p>
	
	                      </div>
	                      <div class="des"><b><a href="/index.php/home/assignment/a_id/<?php echo $v['a_id']?>"><?php echo splitx($v['a_title']);?></a></b><br />
	                        <?php echo lang('start_date')?>：<?php echo str_replace('-','/',$v['a_sdate']);?><br />
	                      	<?php echo lang('end_date')?>：<?php echo str_replace('-','/',$v['a_edate']);?>
	                      </div>
                    </div>
                  <?php }
						}?>
      <div class="pages"><?php echo $assignments['pagebar']?></div>
              </td>
              <td class="table2RightBorder"></td>

            </tr>
            <tr>
              <td class="table2BottomLeft"></td>
              <td class="table2Bottom"></td>
              <td class="table2BottomRight"></td>
            </tr>
          </table></td>
        </tr>
      </table>
<script>
new PCAS("province","city","area","<?php echo $con['province']?>","<?php echo $con['city']?>","<?php echo $con['area']?>");

</script>
    </div>
</div>
</div>
<?php include_once("footer.html")?>

<script type="text/javascript">
function getBrand(c_id){
	//alert(c_id);

	/**** 清除所有的选择项 start ****/
	/* Added by Wendy 2010.10.14 */
	var selobj = $('brand_container');
	for(var i in selobj.options){
		selobj.options[i] = null;
		}
	/**** 清除所有的选择项 end ****/

		if(c_id == ''){
			selobj.options[0] = new Option('--', '');
			//alert("ok");
			return ;
		}
		var url = "<?php echo $www_site_url?>/admin.php?action=corporation&view=ajaxbrand&c_id="+c_id;
		//alert(url);
		mini.ajax.get(url, function(r){

			var r = eval('(' + r + ')');

			if(r.s==200){
				var obj = eval('(' + r.d + ')');
				var selobj = $('brand_container');

				//若有返回的数据，则生成选择项；若没有数据，则生成唯一的选择项“--”
				if(obj != ''){
					for(var i in obj){
						//if(i==0) selobj.options[0] = new Option(obj[i].cs_name, obj[i].cs_id) //replace 1st option with a new one
						selobj.options[i]=new Option(obj[i].b_name,obj[i].b_id) //add a new option to the end of SELECT
					}
				}
				else{
					selobj.options[0] = new Option('--', '');
				}

			}
			if(r.s==400){
				$('msg').innerHTML = r.m;
			}
		});

		return false;
	}


</script>